<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>菜单管理</title> <#include "/WEB-INF/content/module-edit.html">
<script type="text/javascript">
var sysStatus = [
        		<#list map["status"] as sysStatus>
        		<#if sysStatus_index!=0>
        		,
        		</#if>
                  {"id":"${sysStatus.ecode}","text":"${sysStatus.ename}"}
        		</#list>
        ];
var modes = [
        		<#list map["modes"] as status>
        		<#if status_index!=0>
        		,
        		</#if>
                  {"id":"${status.ecode}","text":"${status.ename}"}
        		</#list>
        ];
  	$(function() {
  		$("#status").combobox({
  			valueField : 'id',
  			textField : 'text',
  			editable:false,
  			data:sysStatus
  		}); 
  		$('#code').validatebox({
			required : true,
			validType : [
					"code",
					'remote["${request.contextPath}/sys/menu/validate/code", "code", "${object.code!}"]' ]
		});
  		$("#mode").combobox({
  			valueField : 'id',
  			textField : 'text',
  			editable:false,
  			data:modes
  		}); 
		 
		$('#sort').numberspinner({  editable:false ,min:1,increment:1 });
  	});
</script>
 
</head>
<body class="easyui-layout">
	<div region="north" id="toolbar"
		style="background-color: #eee; padding: 5px; overflow: hidden;"
		border="false">
		<#if object.code?exists&&object.code!=""> <@auth
		code="sys:function:*:update"><a href="#" class="easyui-linkbutton"
			plain="true" iconCls="icon-add" style="border: 1px solid #ccc"
			onclick="javascript:save()">保存</a></@auth> <#else> <@auth
		code="sys:function:*:create"><a href="#" class="easyui-linkbutton"
			plain="true" iconCls="icon-add" style="border: 1px solid #ccc"
			onclick="javascript:save()">保存</a></@auth> </#if><a
			href="#" class="easyui-linkbutton" plain="true" iconCls="icon-edit"
			style="border: 1px solid #ccc" onclick="javascript:cancel()">关闭</a>
	</div>
	<div region="center">
		<div id="p" class="easyui-panel"
			style="background: #fafafa; padding: 10px" fit="true"
			toolbar="#toolbar">
			<form id="form" method="post">
				<table class="form" cellspacing="0" style="width: 100%">
					<tbody style="border: 1px solid #ccc">
						<tr style="display: none;">
							<td colspan="6"><input id="_id" value="${object.code!}"></td>
						</tr>
						<tr>
							<td class="label">编码：</td>
							<td><#if object.code?exists&&object.code!=""> <#assign
								readonly="readonly=\"readonly\""> </#if> <input id="code"
								name="code" value="${object.code!}" style="width: 95%;"
								${readonly!} />
							</td>
							<td class="validate">*</td>
							<td class="label">所属菜单：</td>
							<td><input id="menus" type="hidden" name="parent"
								value="${map['menus'].code!}" />${map["menus"].name!}[${map['menus'].code!}]</td>
							<td class="validate"></td>
						</tr>
						<tr>
							<td class="label">名称：</td>
							<td colspan="4"><input id="name" style="width: 95%;" name="name" class="easyui-validatebox"  required="true"
								value="${object.name!}" /></td>
							<td class="validate">*</td>
						</tr>
						<tr>
							<td class="label">权限码：</td>
							<td colspan="4"><input id="auth" style="width: 95%;" name="auth" class="easyui-validatebox" required="true"
								value="${object.auth!}" /></td>
							<td class="validate">*</td>
						</tr>
						<tr>
							<td class="label">验证方式：</td>
							<td ><input id="mode"   name="mode" required="true"
								value="${object.mode!'AUTH'}" /></td>
							<td class="validate">*</td>
							<td class="label">排序：</td>
							<td><input id="sort" name="sort" required="true"
								value="${object.sort!1}" /></td>
							<td class="validate">*</td>
						</tr>
						
						<tr>
							<td class="label">状态：</td>
							<td><input id="status" name="status" required="true"
								value="${object.status!'ENABLE'}" /></td>
							<td class="validate">*</td>
							<td class="label">创建时间：</td>
							<td>${object.create_time!}</td>
							<td class="validate"></td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>